package com.hsd.znsh.service.impl;

import com.hsd.znsh.repository.BaseRepository;
import com.hsd.znsh.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service("baseService")
@Transactional
public class BaseServiceImpl implements BaseService {

    @Autowired
    public BaseRepository baseRepository;

    @Override
    public <T> T get(String hql,Map<String, Object> params) {
        return baseRepository.get(hql,params);
    }

    @Override
    public <T> T get(String hql, Object object) {
        return baseRepository.get(hql,object);
    }

    @Override
    public <T> List<T> find(String hql, Map<String, Object> params) {
        return baseRepository.find(hql,params);
    }

    @Override
    public <T> List<T> find(String hql, Object object) {
        return baseRepository.find(hql,object);
    }

    @Override
    public <T> List<T> find(String hql, Map<String, Object> params, Pageable pageable) {
        return baseRepository.find(hql,params,pageable);
    }

    @Override
    public <T> List<T> find(String hql, Object object, Pageable pageable) {
        return baseRepository.find(hql,object,pageable);
    }

    @Override
    public long count(String hql, Object object) {
        return baseRepository.count(hql,object);
    }

    @Override
    public long count(String hql, Map<String, Object> params) {
        return baseRepository.count(hql,params);
    }

}
